<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>其他获取dom元素方法</title>
</head>
<body>
<div id="rode"></div>
<div class="lode"></div>
<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>
<script>
// 1.通过id获取到
const rode = document.getElementById("rode")
rode.innerText = "rode erode corrode"
// 2.通过class获取到一组伪数组
const lode = document.getElementsByClassName("lode")
lode[0].innerText = "lode ore explode implode"
// 3.通过标签获取到一组伪元素
const code = document.getElementsByTagName("li")
for(let i=0;i<code.length;i++){
    code[i].innerText = "decode"
}
</script>
</body>
</html>